package com.chainyoung.trademarket.mvp.model;


import com.chainyoung.common.bean.UserInfo;
import com.chainyoung.common.di.scope.FragmentScope;
import com.chainyoung.common.integration.IRepositoryManager;
import com.chainyoung.common.mvp.BaseModel;
import com.chainyoung.common.utils.RxUtils;
import com.chainyoung.trademarket.api.MainService;
import com.chainyoung.trademarket.di.module.FindData;
import com.chainyoung.trademarket.mvp.contract.FindContract;

import java.util.TreeMap;

import javax.inject.Inject;

import io.reactivex.Flowable;

@FragmentScope
public class FindModel extends BaseModel implements FindContract.Model {

    @Inject
    public FindModel(IRepositoryManager repositoryManager) {
        super(repositoryManager);
    }

    @Override
    public Flowable<FindData> getFindData() {
        return mRepositoryManager.obtainRetrofitService(MainService.class)
                .getFindData()
                //.compose(RxUtils.<BaseResponse<UserInfo>>rxSchedulerHelper())
                .compose(RxUtils.<FindData>handleResult());
    }
}
